<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>地铁地图</title>
		<style type="text/css">
			html {
				height: 100%
			}

			body {
				height: 100%;
				margin: 0px;
				padding: 0px
			}

			#container {
				height: 100%
			}
		</style>
	</head>
	<body>
		<div id='container'></div>
	</body>
	<!-- 微信 JS-SDK 如果不需要兼容小程序，则无需引用此 JS 文件 -->
	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>

	<!-- uni 的 SDK -->
	<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>

	<!-- 百度地图 -->

	<script type="text/javascript"
		src="https://api.map.baidu.com/api?type=subway&v=1.0&ak=Af6FfpOOZrHT1Ff2enuUKMZgjz4NfQ3W"></script>

	<script type="text/javascript">
		document.addEventListener('UniAppJSBridgeReady', function() {
			/* globals BMapSub */
			var subwayCityName = '西安';
			var list = BMapSub.SubwayCitiesList;
			var subwaycity = null;
			for (var i = 0; i < list.length; i++) {
				if (list[i].name === subwayCityName) {
					subwaycity = list[i];
					break;
				}
			}
			// 获取北京地铁数据-初始化地铁图
			var subway = new BMapSub.Subway('container', subwaycity.citycode);
			subway.setZoom(0.2);
			var zoomControl = new BMapSub.ZoomControl({
				anchor: BMAPSUB_ANCHOR_BOTTOM_RIGHT,
				offset: new BMapSub.Size(10, 10)
			});
			subway.addControl(zoomControl);
		});
	</script>
</html>
